3.66 \(\int \frac{A+B \sin (e+f x)}{(a+a \sin (e+f x))^2 (c-c \sin (e+f x))^2} \, dx\)

Optimal. Leaf size=62 \[ \frac{A \tan ^3(e+f x)}{3 a^2 c^2 f}+\frac{A \tan (e+f x)}{a^2 c^2 f}+\frac{B \sec ^3(e+f x)}{3 a^2 c^2 f} \]

[Out]

(B*Sec[e + f*x]^3)/(3*a^2*c^2*f) + (A*Tan[e + f*x])/(a^2*c^2*f) + (A*Tan[e + f*x]^3)/(3*a^2*c^2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.139538, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {2967, 2669, 3767} \[ \frac{A \tan ^3(e+f x)}{3 a^2 c^2 f}+\frac{A \tan (e+f x)}{a^2 c^2 f}+\frac{B \sec ^3(e+f x)}{3 a^2 c^2 f} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Sin[e + f*x])/((a + a*Sin[e + f*x])^2*(c - c*Sin[e + f*x])^2),x]

[Out]

(B*Sec[e + f*x]^3)/(3*a^2*c^2*f) + (A*Tan[e + f*x])/(a^2*c^2*f) + (A*Tan[e + f*x]^3)/(3*a^2*c^2*f)

Rule 2967

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a^m*c^m, Int[Cos[e + f*x]^(2*m)*(c + d*Sin[e + f*x])^(n - m)*(A + B
*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && I
ntegerQ[m] &&  !(IntegerQ[n] && ((LtQ[m, 0] && GtQ[n, 0]) || LtQ[0, n, m] || LtQ[m, n, 0]))

Rule 2669

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b*(g*Cos[
e + f*x])^(p + 1))/(f*g*(p + 1)), x] + Dist[a, Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x]
&& (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin{align*} \int \frac{A+B \sin (e+f x)}{(a+a \sin (e+f x))^2 (c-c \sin (e+f x))^2} \, dx &=\frac{\int \sec ^4(e+f x) (A+B \sin (e+f x)) \, dx}{a^2 c^2}\\ &=\frac{B \sec ^3(e+f x)}{3 a^2 c^2 f}+\frac{A \int \sec ^4(e+f x) \, dx}{a^2 c^2}\\ &=\frac{B \sec ^3(e+f x)}{3 a^2 c^2 f}-\frac{A \operatorname{Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (e+f x)\right )}{a^2 c^2 f}\\ &=\frac{B \sec ^3(e+f x)}{3 a^2 c^2 f}+\frac{A \tan (e+f x)}{a^2 c^2 f}+\frac{A \tan ^3(e+f x)}{3 a^2 c^2 f}\\ \end{align*}

Mathematica [A]  time = 0.118258, size = 53, normalized size = 0.85 \[ \frac{A \left (\frac{1}{3} \tan ^3(e+f x)+\tan (e+f x)\right )}{a^2 c^2 f}+\frac{B \sec ^3(e+f x)}{3 a^2 c^2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Sin[e + f*x])/((a + a*Sin[e + f*x])^2*(c - c*Sin[e + f*x])^2),x]

[Out]

(B*Sec[e + f*x]^3)/(3*a^2*c^2*f) + (A*(Tan[e + f*x] + Tan[e + f*x]^3/3))/(a^2*c^2*f)

________________________________________________________________________________________

Maple [B]  time = 0.066, size = 145, normalized size = 2.3 \begin{align*} 2\,{\frac{1}{f{c}^{2}{a}^{2}} \left ( -1/3\,{\frac{A/2+B/2}{ \left ( \tan \left ( 1/2\,fx+e/2 \right ) -1 \right ) ^{3}}}-1/2\,{\frac{A/2+B/2}{ \left ( \tan \left ( 1/2\,fx+e/2 \right ) -1 \right ) ^{2}}}-{\frac{A/2+B/4}{\tan \left ( 1/2\,fx+e/2 \right ) -1}}-1/2\,{\frac{-A/2+B/2}{ \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-1/3\,{\frac{A/2-B/2}{ \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{3}}}-{\frac{A/2-B/4}{\tan \left ( 1/2\,fx+e/2 \right ) +1}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sin(f*x+e))/(a+a*sin(f*x+e))^2/(c-c*sin(f*x+e))^2,x)

[Out]

2/f/c^2/a^2*(-1/3*(1/2*A+1/2*B)/(tan(1/2*f*x+1/2*e)-1)^3-1/2*(1/2*A+1/2*B)/(tan(1/2*f*x+1/2*e)-1)^2-(1/2*A+1/4
*B)/(tan(1/2*f*x+1/2*e)-1)-1/2*(-1/2*A+1/2*B)/(tan(1/2*f*x+1/2*e)+1)^2-1/3*(1/2*A-1/2*B)/(tan(1/2*f*x+1/2*e)+1
)^3-(1/2*A-1/4*B)/(tan(1/2*f*x+1/2*e)+1))

________________________________________________________________________________________

Maxima [A]  time = 0.987443, size = 63, normalized size = 1.02 \begin{align*} \frac{\frac{{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} A}{a^{2} c^{2}} + \frac{B}{a^{2} c^{2} \cos \left (f x + e\right )^{3}}}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))^2/(c-c*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/3*((tan(f*x + e)^3 + 3*tan(f*x + e))*A/(a^2*c^2) + B/(a^2*c^2*cos(f*x + e)^3))/f

________________________________________________________________________________________

Fricas [A]  time = 1.61172, size = 103, normalized size = 1.66 \begin{align*} \frac{{\left (2 \, A \cos \left (f x + e\right )^{2} + A\right )} \sin \left (f x + e\right ) + B}{3 \, a^{2} c^{2} f \cos \left (f x + e\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))^2/(c-c*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

1/3*((2*A*cos(f*x + e)^2 + A)*sin(f*x + e) + B)/(a^2*c^2*f*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [A]  time = 17.455, size = 651, normalized size = 10.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))**2/(c-c*sin(f*x+e))**2,x)

[Out]

Piecewise((-6*A*tan(e/2 + f*x/2)**5/(3*a**2*c**2*f*tan(e/2 + f*x/2)**6 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**4 + 9
*a**2*c**2*f*tan(e/2 + f*x/2)**2 - 3*a**2*c**2*f) + 4*A*tan(e/2 + f*x/2)**3/(3*a**2*c**2*f*tan(e/2 + f*x/2)**6
 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**4 + 9*a**2*c**2*f*tan(e/2 + f*x/2)**2 - 3*a**2*c**2*f) - 6*A*tan(e/2 + f*x/
2)/(3*a**2*c**2*f*tan(e/2 + f*x/2)**6 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**4 + 9*a**2*c**2*f*tan(e/2 + f*x/2)**2
- 3*a**2*c**2*f) + B*tan(e/2 + f*x/2)**6/(3*a**2*c**2*f*tan(e/2 + f*x/2)**6 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**
4 + 9*a**2*c**2*f*tan(e/2 + f*x/2)**2 - 3*a**2*c**2*f) - 9*B*tan(e/2 + f*x/2)**4/(3*a**2*c**2*f*tan(e/2 + f*x/
2)**6 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**4 + 9*a**2*c**2*f*tan(e/2 + f*x/2)**2 - 3*a**2*c**2*f) + 3*B*tan(e/2 +
 f*x/2)**2/(3*a**2*c**2*f*tan(e/2 + f*x/2)**6 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**4 + 9*a**2*c**2*f*tan(e/2 + f*
x/2)**2 - 3*a**2*c**2*f) - 3*B/(3*a**2*c**2*f*tan(e/2 + f*x/2)**6 - 9*a**2*c**2*f*tan(e/2 + f*x/2)**4 + 9*a**2
*c**2*f*tan(e/2 + f*x/2)**2 - 3*a**2*c**2*f), Ne(f, 0)), (x*(A + B*sin(e))/((a*sin(e) + a)**2*(-c*sin(e) + c)*
*2), True))

________________________________________________________________________________________

Giac [A]  time = 1.19815, size = 117, normalized size = 1.89 \begin{align*} -\frac{2 \,{\left (3 \, A \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 3 \, B \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 2 \, A \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 3 \, A \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + B\right )}}{3 \,{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 1\right )}^{3} a^{2} c^{2} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))^2/(c-c*sin(f*x+e))^2,x, algorithm="giac")

[Out]

-2/3*(3*A*tan(1/2*f*x + 1/2*e)^5 + 3*B*tan(1/2*f*x + 1/2*e)^4 - 2*A*tan(1/2*f*x + 1/2*e)^3 + 3*A*tan(1/2*f*x +
 1/2*e) + B)/((tan(1/2*f*x + 1/2*e)^2 - 1)^3*a^2*c^2*f)